/*
 *
 */
jsx3.Class.defineClass(
        "tibco.admin.enterpriseAssets.shdResDefs.RV.ShdRVResDefs", //the full name of the class to create
        jsx3.lang.Object, //  extends class
        [tibco.admin.enterpriseAssets.shdResDefs.ShdResDefsInterface], // implements interface
        function (plugin) {

            plugin.prototype.details = null;
            // TODO: handle multiple instances?

            // Implementation of the ShdResDefsInterface
            plugin.instance = null

            plugin.prototype.initPlugin = function() {
                tibco.admin.Main.loadResource("tibco/admin/enterpriseAssets/shdResDefs/RV/jss/jss.xml", "tibco.admin", "jss_25E", "ljss", false);
                tibco.admin.Main.loadResource("tibco/admin/enterpriseAssets/shdResDefs/RV/jss/valueJSS.xml", "tibco.admin", "value_25E", "jss", false);
            }

            plugin.prototype.destroyPlugin = function() {
            }

            plugin.getInstance = function(args) {
                if(!this.instance) {
                    this.instance = new tibco.admin.enterpriseAssets.shdResDefs.RV.ShdRVResDefs();
                }
                return this.instance;
            }

            plugin.prototype.loadComponent = function(parent, master, id, name, description) {
                var me = this;
                this.details = new tibco.admin.enterpriseAssets.shdResDefs.RV.ShdRVResDefDetails(master, parent, id,
                        name, description, me);
                this.details.loadView();
                return this.details;
            }

            plugin.prototype.getType = function() {
                return "Rendezvous";
            }

            plugin.prototype.getAddText = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@AddText_RV");
            }

            plugin.prototype.getImagePath = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@addin@RV Icon Path");
            }

            plugin.prototype.addSharedResourceDefinition = function(parent, master) {
                var me = this;
                this.details = new tibco.admin.enterpriseAssets.shdResDefs.RV.ShdRVResDefDetails(master, parent, null,
                        null, null, me);
                this.details.loadAdd();
                return this.details;
            }
            // End implementation of the ShdResDefsInterface

        });

jsx3.Class.defineClass(
        "tibco.admin.enterpriseAssets.shdResDefs.RV.ShdRVResDefDetails", //the full name of the class
        tibco.admin.enterpriseAssets.shdResDefs.ShdResDefDetails, //  extends ShdResDefDetails
        null, // implements no interface
        function (details) {
            details.ONTYPESELECTED = "tibco.admin.enterpriseAssets.shdResDefs.RV.TYPESELECTED";

            details.prototype.subType = null;
            details.prototype.helpID = "EnterpriseAssets.SharedResourceDefinitions.SharedResourceDefinitions.Rendezvous";

            details.prototype.init = function(master, parent, id, name, description, handler) {
                this.jsxsuper(master, parent, id, name, description, handler);
                this.editableComponentList.addAll(["txtDaemon_25E", "txtNetWork_25E", "txtService_25E", "selSubtype_25E",
                        "txtCmName_25E", "txtLedgerFile_25E", "txtRelayAgent_25E",
                        "txtMessageTimeout_25E", "txtCMQName_25E",
                        "txtWorkerWeight_25E", "txtWorkerTasks_25E", "txtWorkerCompleteTime_25E", "txtSchedulerWeight_25E",
                        "txtSchedulerHeartbeat_25E", "txtSchedulerActivation_25E"], this.editableComponentList.size());
                this.rwComponentList.addAll(["txtDaemon_25E", "txtNetWork_25E", "txtService_25E", "selSubtype_25E",
                        "txtCmName_25E", "txtLedgerFile_25E", "blkSyncLedgerFileYesNo_25E", "txtRelayAgent_25E",
                        "blkRequireOldMessageYesNo_25E", "txtMessageTimeout_25E", "txtCMQName_25E",
                        "txtWorkerWeight_25E", "txtWorkerTasks_25E", "txtWorkerCompleteTime_25E", "txtSchedulerWeight_25E",
                        "txtSchedulerHeartbeat_25E", "txtSchedulerActivation_25E"], this.rwComponentList.size());
                this.roComponentList.addAll(["lblcDaemon_25E", "lblcNetwork_25E", "lblcService_25E", "lblcSubtype_25E",
                        "lblcCmName_25E", "lblcLedgerFile_25E", "lblcSyncLedgerFile_25E", "lblcRelayAgent_25E",
                        "lblcRequireOldMessage_25E", "lblcMessageTimeout_25E", "lblcCMQName_25E", "lblcWorkerWeight_25E", "lblcWorkerTasks_25E",
                        "lblcWorkerCompleteTime_25E", "lblcSchedulerWeight_25E", "lblcSchedulerHeartbeat_25E",
                        "lblcSchedulerActivation_25E"], this.roComponentList.size());
            }

            details.prototype.getType = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@SRDType_RV");
            }

            details.prototype.getHelpId = function() {
                return this.helpID;
            }

            details.prototype.getDetailsOperation = function() {
                return "getRVResourceDetails";
            }
            details.prototype.getDetailsOperationRules = function() {
                return "tibco/admin/enterpriseAssets/shdResDefs/RV/rules/getRVResourceDetails.xml";
            }
            details.prototype.editOperation = function() {
                return "editRVResource";
            }
            details.prototype.editOperationRules = function() {
                return "tibco/admin/enterpriseAssets/shdResDefs/RV/rules/editRVResource.xml";
            }
            details.prototype.addOperation = function() {
                return "addRVResource";
            }
            details.prototype.addOperationRules = function() {
                return "tibco/admin/enterpriseAssets/shdResDefs/RV/rules/addRVResource.xml";
            }
            details.prototype.getDetailsComponent = function() {
                return "tibco/admin/enterpriseAssets/shdResDefs/RV/components/shdRVResDefDetails.xml";
            }
            details.prototype.getSecondaryDetailsComponent = function() {
                return null;
            }

            // TODO: make name unique
            details.prototype.getDefaultName = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@defaultName_RV");
            }
            details.prototype.getDefaultDescription = function() {
                return tibco.admin.Main.getServer().getDynamicProperty("@defaultDescription_RV");
            }

            details.prototype.initializeSpecificDetails = function(objEvent) {
                if(objEvent.status == "SUCCESS") {

                    var str = '<data jsxid="jsxroot">';
                    str += '<record jsxid="RVReliable" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVReliable_25E") + '" />';
                    str += '<record jsxid="RVCertified" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVCertified_25E") + '" />';
                    str += '<record jsxid="RVDistributedQueue" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVDistributedQueue_25E") + '" />';
                    str += '</data>';
                    var sel = this.mainComponent.getDescendantOfName("selSubtype_25E");
                    tibco.admin.Main.getServer().getCache().clearById(sel.getXMLId());
                    sel.setXMLString(str);
                    sel.setValue("RVReliable");
                    sel.repaint();

                    this.mainComponent.getDescendantOfName("selSubtype_25E").subscribe(details.ONTYPESELECTED,
                            this, this.showSubDetails);
                }
                this.jsxsuper(objEvent);

                objEvent.obj.handler = this;
            }

            details.prototype.initializeSpecificAdd = function(objEvent) {
                if(objEvent.status == "SUCCESS") {

                    var str = '<data jsxid="jsxroot">';
                    str += '<record jsxid="RVReliable" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVReliable_25E") + '" />';
                    str += '<record jsxid="RVCertified" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVCertified_25E") + '" />';
                    str += '<record jsxid="RVDistributedQueue" jsxtext="' + tibco.admin.Main.getServer().getDynamicProperty("@@RVDistributedQueue_25E") + '" />';
                    str += '</data>';
                    var sel = this.mainComponent.getDescendantOfName("selSubtype_25E");
                    tibco.admin.Main.getServer().getCache().clearById(sel.getXMLId());
                    sel.setXMLString(str);
                    sel.setValue("RVReliable");
                    sel.repaint();

                    this.mainComponent.getDescendantOfName("txtDaemon_25E").setValue(tibco.admin.Main.getServer().getDynamicProperty("@@defaultDeamon_25E"));
                    this.mainComponent.getDescendantOfName("txtNetWork_25E").setValue(tibco.admin.Main.getServer().getDynamicProperty("@@defaultNetwork_25E"));
                    this.mainComponent.getDescendantOfName("txtService_25E").setValue(tibco.admin.Main.getServer().getDynamicProperty("@@defaultService_25E"));

                    this.mainComponent.getDescendantOfName("selSubtype_25E").subscribe(details.ONTYPESELECTED,
                            this, this.showSubDetails);
                }
                this.jsxsuper(objEvent);

                objEvent.obj.handler = this;
                this.showSubDetails();
            }

            details.prototype.ongetConfigDetailsSuccess = function(objEvent) {
                var obj = tibco.admin.Main.getServer().getJSXByName("blkDetailsForType_25E");
                var response = tibco.admin.Main.getServer().Cache.getDocument("xmlCacheIDGetRVDetailsResponse_25E").getRecordNode("jsxroot");
                this.jsxsuper(response);
                var value = response.getAttribute("daemon");
                this.mainComponent.getDescendantOfName("lblcDaemon_25E").setText(value ? value : "", true);
                this.mainComponent.getDescendantOfName("txtDaemon_25E").setValue(value, true);
                value = response.getAttribute("network");
                this.mainComponent.getDescendantOfName("lblcNetwork_25E").setText(value ? value : "", true);
                this.mainComponent.getDescendantOfName("txtNetWork_25E").setValue(value, true);
                value = response.getAttribute("service");
                this.mainComponent.getDescendantOfName("lblcService_25E").setText(value ? value : "", true);
                this.mainComponent.getDescendantOfName("txtService_25E").setValue(value, true);
                value = response.getAttribute("subtype");
                this.mainComponent.getDescendantOfName("selSubtype_25E").setValue(value, true);
                // TODO: set callback on select button to switch displayed blocks
                this.mainComponent.getDescendantOfName("blkCmName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkSyncLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkRelayAgent_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkRequireOldMessage_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkMessageTimeout_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkCMQName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkWorkerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkWorkerTasks_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkWorkerCompleteTime_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkSchedulerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkSchedulerHeartbeat_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("blkSchedulerActivation_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                this.mainComponent.getDescendantOfName("lblcSubtype_25E").setText(tibco.admin.Main.getServer().getDynamicProperty("@@RVReliable_25E"), true);
                switch(value) {
                    case "RVReliable":
                        break;
                    case "RVCertified":
                        this.mainComponent.getDescendantOfName("lblcSubtype_25E").setText(tibco.admin.Main.getServer().getDynamicProperty("@@RVCertified_25E"), true);
                        value = response.getAttribute("cmName");
                        this.mainComponent.getDescendantOfName("lblcCmName_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtCmName_25E").setValue(value, true);
                        value = response.getAttribute("ledgerFile");
                        this.mainComponent.getDescendantOfName("lblcLedgerFile_25E").setText(value ? value : "", true);;
                        this.mainComponent.getDescendantOfName("txtLedgerFile_25E").setValue(value, true);;
                        value = response.getAttribute("syncLedgerFile");
                        this.mainComponent.getDescendantOfName("lblcSyncLedgerFile_25E").setText((value == "true") ? tibco.admin.Main.getServer().getDynamicProperty("@@radRequireOldMessageYes_25E") : tibco.admin.Main.getServer().getDynamicProperty("@@radRequireOldMessageNo_25E"), true);
                        this.mainComponent.getDescendantOfName("radSyncLedgerFileYes_25E").setGroupValue(value, true);
                        value = response.getAttribute("relayAgent");
                        this.mainComponent.getDescendantOfName("lblcRelayAgent_25E").setText(value ? value : "", true);;
                        this.mainComponent.getDescendantOfName("txtRelayAgent_25E").setValue(value, true);;
                        value = response.getAttribute("requireOldMessages");
                        this.mainComponent.getDescendantOfName("lblcRequireOldMessage_25E").setText((value == "true") ? tibco.admin.Main.getServer().getDynamicProperty("@@radRequireOldMessageYes_25E") : tibco.admin.Main.getServer().getDynamicProperty("@@radRequireOldMessageNo_25E"), true);
                        this.mainComponent.getDescendantOfName("radRequireOldMessageYes_25E").setGroupValue(value, true);
                        value = response.getAttribute("messageTimeout");
                        this.mainComponent.getDescendantOfName("lblcMessageTimeout_25E").setText(value, true);;
                        this.mainComponent.getDescendantOfName("txtMessageTimeout_25E").setValue(value, true);;
                        break;
                    case "RVDistributedQueue":
                        this.mainComponent.getDescendantOfName("lblcSubtype_25E").setText(tibco.admin.Main.getServer().getDynamicProperty("@@RVDistributedQueue_25E"), true);
                        value = response.getAttribute("cmqName");
                        this.mainComponent.getDescendantOfName("lblcCMQName_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtCMQName_25E").setValue(value, true);
                    // TODO: set callback on button to display picker dialog
                        value = response.getAttribute("workerWeight");
                        this.mainComponent.getDescendantOfName("lblcWorkerWeight_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtWorkerWeight_25E").setValue(value, true);
                        value = response.getAttribute("workerTasks");
                        this.mainComponent.getDescendantOfName("lblcWorkerTasks_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtWorkerTasks_25E").setValue(value, true);
                        value = response.getAttribute("workerCompleteTime");
                        this.mainComponent.getDescendantOfName("lblcWorkerCompleteTime_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtWorkerCompleteTime_25E").setValue(value, true);
                        value = response.getAttribute("schedulerWeight");
                        this.mainComponent.getDescendantOfName("lblcSchedulerWeight_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtSchedulerWeight_25E").setValue(value, true);
                        value = response.getAttribute("schedulerHeartbeat");
                        this.mainComponent.getDescendantOfName("lblcSchedulerHeartbeat_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtSchedulerHeartbeat_25E").setValue(value, true);
                        value = response.getAttribute("schedulerActivation");
                        this.mainComponent.getDescendantOfName("lblcSchedulerActivation_25E").setText(value, true);
                        this.mainComponent.getDescendantOfName("txtSchedulerActivation_25E").setValue(value, true);
                        break;
                }
                var me = this;
                setTimeout(function() {
                    me.setEditable(true);
                    me.showSubDetails();
                },0);
            }

            details.prototype.showSubDetails = function(event) {
                var obj = tibco.admin.Main.getServer().getJSXByName("blkDetailsForType_25E");
                switch(this.mainComponent.getDescendantOfName("selSubtype_25E").getValue()) {
                    case "RVReliable":
                        this.mainComponent.getDescendantOfName("blkCmName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSyncLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkRelayAgent_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkRequireOldMessage_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkMessageTimeout_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkCMQName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerTasks_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerCompleteTime_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerHeartbeat_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerActivation_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);

                        this.passedItems = {};//070818
                        this.passedItems["namePassed"] = tibco.admin.util.Validation.trimAll(this.mainComponent.getDescendantOfName("txtName_25").getValue())?true:false;//070818
                        this.enableSaveBtn4Add();//070818

                        break;
                    case "RVCertified":
                        this.mainComponent.getDescendantOfName("blkCMQName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerTasks_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkWorkerCompleteTime_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerHeartbeat_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerActivation_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);

                        this.mainComponent.getDescendantOfName("blkCmName_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkSyncLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkRelayAgent_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkRequireOldMessage_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkMessageTimeout_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.fixRow(this.mainComponent.getDescendantOfName("blkCmName_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkLedgerFile_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkSyncLedgerFile_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkRelayAgent_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkRequireOldMessage_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkMessageTimeout_25E"));

                        obj.adoptChild(obj.getChild("blkCMQName_25E"), true);
                        obj.adoptChild(obj.getChild("blkWorkerWeight_25E"), true);
                        obj.adoptChild(obj.getChild("blkWorkerTasks_25E"), true);
                        obj.adoptChild(obj.getChild("blkWorkerCompleteTime_25E"), true);
                        obj.adoptChild(obj.getChild("blkSchedulerWeight_25E"), true);
                        obj.adoptChild(obj.getChild("blkSchedulerHeartbeat_25E"), true);
                        obj.adoptChild(obj.getChild("blkSchedulerActivation_25E"), true);
                        this.passedItems = {};//070818
                        this.passedItems["namePassed"] = tibco.admin.util.Validation.trimAll(this.mainComponent.getDescendantOfName("txtName_25").getValue())?true:false;//070818
                        this.passedItems["RVCMName"] = tibco.admin.util.Validation.trimAll(this.mainComponent.getDescendantOfName("txtCmName_25E").getValue())?true:false;//070818
                        this.enableSaveBtn4Add();//070818

                        break;
                    case "RVDistributedQueue":
                        this.mainComponent.getDescendantOfName("blkCmName_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkSyncLedgerFile_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkRelayAgent_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkRequireOldMessage_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);
                        this.mainComponent.getDescendantOfName("blkMessageTimeout_25E").setDisplay(jsx3.gui.Block.DISPLAYNONE, true);

                        this.mainComponent.getDescendantOfName("blkCMQName_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkWorkerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkWorkerTasks_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkWorkerCompleteTime_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerWeight_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerHeartbeat_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.mainComponent.getDescendantOfName("blkSchedulerActivation_25E").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        this.fixRow(this.mainComponent.getDescendantOfName("blkCMQName_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkWorkerWeight_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkWorkerTasks_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkWorkerCompleteTime_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkSchedulerWeight_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkSchedulerHeartbeat_25E"));
                        this.fixRow(this.mainComponent.getDescendantOfName("blkSchedulerActivation_25E"));
                        obj.adoptChild(obj.getChild("blkCmName_25E"), true);
                        obj.adoptChild(obj.getChild("blkLedgerFile_25E"), true);
                        obj.adoptChild(obj.getChild("blkSyncLedgerFile_25E"), true);
                        obj.adoptChild(obj.getChild("blkRelayAgent_25E"), true);
                        obj.adoptChild(obj.getChild("blkRequireOldMessage_25E"), true);
                        obj.adoptChild(obj.getChild("blkMessageTimeout_25E"), true);
                        this.passedItems = {};//070818
                        this.passedItems["namePassed"] = tibco.admin.util.Validation.trimAll(this.mainComponent.getDescendantOfName("txtName_25").getValue())?true:false;//070818
                        this.passedItems["RVCMQName"] = tibco.admin.util.Validation.trimAll(this.mainComponent.getDescendantOfName("txtCMQName_25E").getValue())?true:false;//070818
                        this.enableSaveBtn4Add();//070818

                        break;
                }
            }

            details.prototype.fixRow = function(obj) {
//                setTimeout(function() {
                    var count = obj.getChildren().length;
                    for(var i = 0; i < count; i++) {
                        obj.adoptChild(obj.getChild(0), true);
                    }
//                }, 50);
            }

            details.prototype.setEditRequestDetails = function(objService) {
                this.setEditAddRequestDetails(objService);
            }

            details.prototype.setAddRequestDetails = function(objService) {
                this.setEditAddRequestDetails(objService);
            }

            details.prototype.setEditAddRequestDetails = function(objService) {
                objService.daemon = this.mainComponent.getDescendantOfName("txtDaemon_25E").getValue();
                objService.network = this.mainComponent.getDescendantOfName("txtNetWork_25E").getValue();
                objService.service = this.mainComponent.getDescendantOfName("txtService_25E").getValue();
                objService.subtype = this.mainComponent.getDescendantOfName("selSubtype_25E").getValue();
                switch(objService.subtype) {
                    case "RVReliable":
                        break;
                    case "RVCertified":
                        objService.cmName = this.mainComponent.getDescendantOfName("txtCmName_25E").getValue();
                        objService.ledgerFile = this.mainComponent.getDescendantOfName("txtLedgerFile_25E").getValue();
                        objService.relayAgent = this.mainComponent.getDescendantOfName("txtRelayAgent_25E").getValue();
                        objService.syncLedgerFile = this.mainComponent.getDescendantOfName("radSyncLedgerFileYes_25E").getGroupValue();
                        objService.requireOldMessages = this.mainComponent.getDescendantOfName("radRequireOldMessageYes_25E").getGroupValue();
                        objService.messageTimeout = this.mainComponent.getDescendantOfName("txtMessageTimeout_25E").getValue();
                        break;
                    case "RVDistributedQueue":
                        objService.cmqName = this.mainComponent.getDescendantOfName("txtCMQName_25E").getValue();
                        objService.workerWeight = this.mainComponent.getDescendantOfName("txtWorkerWeight_25E").getValue();
                        objService.workerTasks = this.mainComponent.getDescendantOfName("txtWorkerTasks_25E").getValue();
                        objService.workerCompleteTime = this.mainComponent.getDescendantOfName("txtWorkerCompleteTime_25E").getValue();
                        objService.schedulerWeight = this.mainComponent.getDescendantOfName("txtSchedulerWeight_25E").getValue();
                        objService.schedulerHeartbeat = this.mainComponent.getDescendantOfName("txtSchedulerHeartbeat_25E").getValue();
                        objService.schedulerActivation = this.mainComponent.getDescendantOfName("txtSchedulerActivation_25E").getValue();
                        break;
                }
            }


            /*070818
               * if user doesn't fishish all the required fields, the "save" button will be disabled.  part 2 for RV
               */
            details.prototype.valiRVCMName = function(obj, strValue) {
                this.passedItems["RVCMName"] = tibco.admin.util.Validation.doValidateNotEmpty(obj, strValue, tibco.admin.Main.getServer().getDynamicProperty("@@CmName_25E"));
                this.enableSaveBtn4Add();
            }

            details.prototype.valiRVCMQName = function(obj, strValue) {
                this.passedItems["RVCMQName"] = tibco.admin.util.Validation.doValidateNotEmpty(obj, strValue, tibco.admin.Main.getServer().getDynamicProperty("@@CMQName_25E"));
                this.enableSaveBtn4Add();
            }

        });

